﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:Lithnet.Transforms.Presentation"
                    xmlns:t="clr-namespace:Lithnet.Transforms;assembly=Lithnet.Transforms"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type vm:SubstringTransformViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Direction"
                       Grid.Row="0"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Source={core:EnumExtension {x:Type t:Direction}}}"
                          SelectedValue="{Binding Direction, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          SelectedValuePath="Value"
                          Grid.Row="0"
                          Grid.Column="1" />

                <Label Content="Start index"
                       Grid.Row="1"
                       Grid.Column="0" />
                <TextBox Text="{Binding StartIndex, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="1"
                         Grid.Column="1"
                         ToolTip="{Binding ToolTips.StartIndex}" />

                <Label Content="Length"
                       Grid.Row="2"
                       Grid.Column="0" />
                <TextBox Text="{Binding Length, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="2"
                         Grid.Column="1"
                         ToolTip="{Binding ToolTips.Length}" />

                <Label Content="Pad type"
                       Grid.Row="3"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Source={core:EnumExtension {x:Type t:PadType}}}"
                          SelectedValue="{Binding PaddingType, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          SelectedValuePath="Value"
                          Grid.Row="3"
                          Grid.Column="1"
                          ToolTip="{Binding ToolTips.PaddingType}" />

                <Label Content="Padding character"
                       Grid.Row="4"
                       Grid.Column="0" />
                <TextBox Text="{Binding PadCharacter, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="4"
                         Grid.Column="1"
                         ToolTip="{Binding ToolTips.PadCharacter}"
                         IsEnabled="{Binding PadCharacterFieldEnabled}" />
            </Grid>
        </StackPanel>
    </DataTemplate>

</ResourceDictionary>